﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YongShuiXX_DBS.aspx.cs" Inherits="Web.Pages.QuShui.XiTongJK.YongShuiXX_DBS" Theme="Default" ValidateRequest="false" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../../../JS/AddEditCancel.js"></script>
    <script src="../../../JS/jquery.js"></script>   
    <script type="text/javascript">
        function search()
        {
            if (txtYM1.GetText() == "")
            {
                alert("请输入开始水量年月");
                txtYM1.Focus();
                return;
            }
            if (txtYM2.GetText() == "") {
                alert("请输入结束水量年月");
                txtYM2.Focus();
                return;
            }
            gvList.PerformCallback();
        }
        function SetListChecked() {
            var len = gvList.GetVisibleRowsOnPage();
            for (var i = 0; i < len; i++) {
                var clientObject = ASPxClientCheckBox.Cast('checked' + i);
                if (clientObject.GetChecked()) {
                    clientObject.SetChecked(false);
                }
                else {
                    clientObject.SetChecked(true);
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            地表水用水信息
        </div>
        <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="loadpanel1" runat="server" ContainerElementID="gvList" Modal="true" Theme="Metropolis" ShowImage="false" Text="加载中"></dx:ASPxLoadingPanel>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div>
                     <div>
                        <div style="float:left;">
                        <table align="left">
                            <tr>
                                <td align="right">水量年月：</td>
                                <td>
                                    <dx:ASPxTextBox ID="txtYM1" ClientInstanceName="txtYM1" runat="server" Width="70px">
                                        <ClientSideEvents  KeyUp="function(s,e){inputNum(s);OnKeyNext(txtYM2);}"/>
                                    </dx:ASPxTextBox>
                                </td>
                                <td>-</td>
                                <td>
                                    <dx:ASPxTextBox ID="txtYM2" ClientInstanceName="txtYM2" runat="server" Width="70px">
                                        <ClientSideEvents  KeyUp="function(s,e){inputNum(s);OnKeyNext(btnSearch);}"/>
                                    </dx:ASPxTextBox>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnSearch" ClientInstanceName="btnSearch" runat="server" Text="查询" AutoPostBack="false" UseSubmitBehavior="false" ClientSideEvents-Click="function(s,e){search();}">
                                    </dx:ASPxButton>
                                </td>
                                <td style="padding-left:10px">
                                    <dx:ASPxButton ID="btnExport" ClientInstanceName="btnExport" runat="server" Text="导出" AutoPostBack="false" UseSubmitBehavior="false" OnClick="btnExport_Click" >
                                    </dx:ASPxButton>
                                </td>
                                <td style="padding-left:10px">
                                    <dx:ASPxButton ID="ASPxButton1" ClientInstanceName="ASPxButton1" runat="server" Text="传输到水务局" AutoPostBack="false" UseSubmitBehavior="false">
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                        </div>
                       <%--  <div style="float:right;">
                        <table>
                            <tr>                                
                                <td>
                                    <dx:ASPxButton ID="btnExport" ClientInstanceName="btnExport" runat="server" Text="导出" AutoPostBack="false" UseSubmitBehavior="false" >
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                        </div>--%>
                    </div>
                    <div id="divList">
                        <dx:ASPxGridView ID="gvList" ClientInstanceName="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="ROWNUM" Theme="Aqua1" Width="100%" OnCustomCallback="gvList_CustomCallback1">
                            <Columns>
                                <dx:GridViewDataTextColumn Caption="" Width="35px">
                                    <HeaderTemplate>
                                         <dx:ASPxCheckBox ID="cbAll" runat="server"  ClientSideEvents-CheckedChanged="function(s,e){SetListChecked()}" Checked="true"></dx:ASPxCheckBox>    
                                    </HeaderTemplate>
                                    <DataItemTemplate>
                                        <dx:ASPxCheckBox ID="cid" runat="server"></dx:ASPxCheckBox>                
                                        <asp:HiddenField ID="id" runat="server" Value='<%#Eval("ROWNUM") %>' />
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="I_YM" Caption="水量年月" Width="15%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="15%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="40%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="N_SHUIJIA" Caption="水价" Width="15%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="I_BENYUESL" Caption="本月水量" Width="30%">
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <ClientSideEvents Init="function(s,e){AdjustSize(70,gvList);}" />
                        </dx:ASPxGridView>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
